﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
//using System.Xml.Linq;
using System.IO;
using System.Collections.Generic;
using Telerik.Web.UI;
using KPIS.Utils;
using KPIS.GERP.GHRMS.BLL;
using KPIS.GERP.GHRMS.IBLL;
using KPIS.GERP.GHRMS.MODEL;
using KPIS.GERP.GHRMS.APP.Classes;

namespace KPIS.GERP.GHRMS.APP.App_UI.Forms
{
    public partial class DialogRC_EduIns : System.Web.UI.Page
    {
        private IMasEducationInstituteBLL insBLL = new MasEducationInstituteBLL();
        protected void Page_Load(object sender, EventArgs e)
        {
            IncludeJava();         
            
            if (!IsPostBack)
            {
                LoadDataGrid();
            }

        }
        public void IncludeJava()
        {
            HtmlGenericControl script = new HtmlGenericControl();
            script.TagName = "script";
            script.Attributes.Add("type", "text/javascript");
            script.Attributes.Add("src", "../../Scripts/jsfunction.js");
            Page.Header.Controls.Add(script);
        }
        public void LoadDataGrid()
        {
            IList<MasEducationInstituteInfo> Info = insBLL.ListEducationInstitutes();
            RadGrid1.DataSource = Info;
            RadGrid1.DataBind();
        }
 
        protected void RadGrid1_ItemCommand(object source, Telerik.Web.UI.GridCommandEventArgs e)
        {
            LoadDataGrid();
        }

        protected void RadGrid1_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
        {
            if (e.Item is GridDataItem)
            {
                GridDataItem item = (GridDataItem)e.Item;
                string Datakey = item.OwnerTableView.DataKeyValues[item.ItemIndex]["Sequence"].ToString();
                ((LinkButton)e.Item.Cells[1].FindControl("targetControl")).Attributes.Add("OnClick", "windowReturn('" + Datakey + "')");
            }
        }

        protected void btnOK_Click(object sender, EventArgs e)
        {

        }
    }
}
